/*
 * SteinhartHartModel.hpp
 *
 * Copyright 2012 Pieter Agten
 *
 * This file is part of tltgen.
 *
 * tltgen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * tltgen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with tltgen.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file   SteinhartHartModel.hpp
 * @author Pieter Agten (pieter.agten@gmail.com)
 * @date   2 sep 2012
 */

#ifndef STEINHARTHARTMODEL_HPP
#define STEINHARTHARTMODEL_HPP

#include "ThermistorModel.hpp"
#include "SteinhartHartModelThermistor.hpp"

#include <boost/shared_ptr.hpp>

using boost::shared_ptr;

namespace tltgen {

  class SteinhartHartModel : public ThermistorModel  {
  public:
    SteinhartHartModel();
    virtual ~SteinhartHartModel();

    virtual std::string getName() const;
    virtual unsigned int getMinNbValues() const;


    virtual shared_ptr<Thermistor> generate(const shared_ptr<ThermistorTable>& thermistorTable, const LeastSquaresSolver& solver);

    virtual unsigned int getNbParameters() const;
    virtual std::string getParameterName(unsigned int pi) const;
    virtual ParameterType getParameterType(unsigned int pi) const;
    virtual void getInitialGuess(double *guess) const;

    virtual bool isParameterFixed(unsigned int pi) const;
    virtual bool hasParameterLowerBound(unsigned int pi) const;
    virtual double getParameterLowerBound(unsigned int pi) const;
    virtual bool hasParameterUpperBound(unsigned int pi) const;
    virtual double getParameterUpperBound(unsigned int pi) const;

    virtual void applyModelFunction(const ThermistorTable* thermistorTable, const double *params, double *residues) const;
    virtual void applyModelDerivative(const ThermistorTable* thermistorTable, const double *params, double *jacobian) const;

  };

}

#endif
